#include "FunctionContentNode.h"

#include "Output/Console.h"

#include "ScriptCompiler/AST/SentenceBlockNode.h"

void CFunctionContentNode::DebugPrint(int32_t InDepth)
{
    if(!IsLambda)
    {
        //print { with depth
        for(int32_t i=0;i<InDepth;++i)
        {
            WH::Print(U"\t");
        }
        WH::Print(U"{\n");

        Content->DebugPrint(InDepth+1);
    
        //print } with depth
        for(int32_t i=0;i<InDepth;++i)
        {
            WH::Print(U"\t");
        }
        WH::Print(U"}\n");
    
    }
    else
    {
        //print blank spaces for depth
        for(int32_t i=0;i<InDepth;i++)
        {
            WH::Print(U"\t");
        }

        //print =>
        WH::Print(U"=> \n");
        

        //print lambda content
        Content->DebugPrint(InDepth+1);
        
        WH::Print(U";\n");
    }

}

std::shared_ptr<CScriptToken> CFunctionContentNode::GetFirstToken()
{
    return FirstToken;
}
